home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / nan_news / toolkit / exist.prg < prev    next >
Text File  |  1991-08-15  |  2KB  |  68 lines

  1. /*
  2.  * File......: EXIST.PRG
  3.  * Author....: Steve Kolterman
  4.  * CIS ID....: 76320,37
  5.  * Date......: $Date:   15 Aug 1991 23:03:34  $
  6.  * Revision..: $Revision:   1.2  $
  7.  * Log file..: $Logfile:   E:/nanfor/src/exist.prv  $
  8.  * 
  9.  * This is an original work by Steve Kolterman and is placed in the
  10.  * public domain.
  11.  *
  12.  * Modification history:
  13.  * ---------------------
  14.  *
  15.  * $Log:   E:/nanfor/src/exist.prv  $
  16.  * 
  17.  *    Rev 1.2   15 Aug 1991 23:03:34   GLENN
  18.  * Forest Belt proofread/edited/cleaned up doc
  19.  * 
  20.  *    Rev 1.1   14 Jun 1991 19:51:48   GLENN
  21.  * Minor edit to file header
  22.  * 
  23.  *    Rev 1.0   01 Apr 1991 01:01:20   GLENN
  24.  * Nanforum Toolkit
  25.  *
  26.  */
  27.  
  28.  
  29. /*  $DOC$
  30.  *  $FUNCNAME$
  31.  *     FT_EXIST()
  32.  *  $CATEGORY$
  33.  *     Environment
  34.  *  $ONELINER$
  35.  *     Test for existence of drive and/or subdirectory
  36.  *  $SYNTAX$
  37.  *     FT_EXIST( <cDriveDir> ) -> lResult
  38.  *  $ARGUMENTS$
  39.  *     <cDriveDir> is a character string containing drive spec (with colon)
  40.  *        or drive spec and path to and including subdirectory being
  41.  *        tested for.  Do not include backslash after subdirectory.  If
  42.  *        drive spec is not part of string, tests current drive.
  43.  *  $RETURNS$
  44.  *     <lResult>  as logical -
  45.  *        .T. if drive exists, or subdirectory exists on specified drive
  46.  *        .F. if drive or subdirectory does not exist
  47.  *  $DESCRIPTION$
  48.  *  
  49.  *  $EXAMPLES$
  50.  *    IF FT_EXIST( "D:" )
  51.  *       Qout("OK To Perform Operation On Drive D:") 
  52.  *    ENDIF
  53.  *  $END$
  54.  */
  55.  
  56.  
  57. /*   Pre-processor option:
  58.  *
  59.  *    #translate FT_EXIST(<drv>) => ;
  60.  *         FILE((<drv>+IF(SUBS(<drv>,-1,1)=="\","","\")+"NUL"))
  61.  *
  62.  */
  63.  
  64.  
  65. FUNCTION FT_EXIST( cDrvDir )
  66.   // check for "\" passed; add if necessary
  67.   RETURN FILE(( cDrvDir + IF(SUBS( cDrvDir, -1, 1) == "\", "", "\" ) + "NUL" ) )
  68.